#ifndef NIGHT_ARRAY_OPS
#define NIGHT_ARRAY_OPS

#include <iostream>
#include <functional>
#include <assert.h>

#include "core.hpp"

namespace night {

namespace array {


template< typename LE, typename LR, typename LS, typename RE, typename RR, typename RS >
bool operator == ( Expr<LE,LR,LS> const & lhs, Expr<RE,RR,RS> const & rhs ) {
	assert ( lhs.size(0) == rhs.size(0) );
	for ( size_type i=0; i< lhs.size(0); ++i ) if ( ! ( lhs[i] == rhs[i] ) ) return false;
	return true;
}

template< typename LE, typename LR, typename LS, typename RE, typename RR, typename RS >
inline bool operator != ( Expr<LE,LR,LS> const & lhs, Expr<RE,RR,RS> const & rhs ) { return ! ( rhs == lhs ); }

template< typename E, typename R, typename S >
std::ostream & operator << ( std::ostream & os, Expr<E,R,S> const & rhs ) {
	os << "[";
	for ( size_type i=0; i< rhs.size(0); ++i ) os << ( i ? "," : "" ) << rhs[i];
	os << "]" << std::endl;
	return os;
}

} // end namespace night::array

} // end namespace night

#endif
